from django.conf import settings
from django.core.files.storage import Storage


class FastDFSStorage(Storage):
    def __init__(self, base_url=None):
        self.base_url = base_url or settings.FDFS_BASE_URL
    #必传
    def _open(self, name, mode='rb'):
        pass

    # 必传
    def _save(self, name, content, max_length=None):
        pass

    def url(self, name):
        return self.base_url + name